package com.example.ftptest;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;

public class MainActivity extends Activity implements OnClickListener {	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		
        View createButton = findViewById(R.id.button1);
        createButton.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				loginFTP();
				
			}
		});
            
        
        
        View exitButton = findViewById(R.id.button4);
        exitButton.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				finish();
			}
		});
	}
	
	public void onClick(View v) {


//	public void createDummyFile() {
//		try {
//			FileOutputStream fos;
//			String file_content = "Hi this is a sample file to upload for android FTP client example";
//			
//			fos = openFileOutput(TEMP_FILENAME, MODE_PRIVATE);
//			fos.write(file_content.getBytes());
//			fos.close();
//			
//		} catch (Exception e) {
//			e.printStackTrace();
//		}

	}
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}
	
	protected void loginFTP() {
		
		Intent loginIntent = new Intent(this,LoginActivity.class);
		startActivity(loginIntent);
	}

}
